#pragma once
#include "StdAfx.h"
#include "Singleton.h"
#include "FactoryManager.h"
#include "IHittable.h"

class IHittable;

using namespace std;

class Object;


class CollisionManager : 
	public Singleton<CollisionManager>
	, public FactoryManager<IHittableFactory>
{
public:

	CollisionManager(void);

	~CollisionManager(void);

	void clear();

	// Callback functions are called based on the signature of the parameters.
	// Return true: Inaccessible.
	bool on_collision(Object& o1, Object& o2);

protected:
	typedef std::map<std::string, IHittableFactory*>	FACTORY_MAP;
	typedef std::map<IHittableFactory*, IHittable*>		HITTABLE_MAP;

	FACTORY_MAP		FactoryMap;
	HITTABLE_MAP	HittableMap;
};
